import { ConfigService } from '@nestjs/config'
import { CaptchaModuleOptions } from '@ttou/nest-captcha'

import { IConfig } from '@/interfaces'

export const CAPTCHA_OPTIONS: CaptchaModuleOptions = {
  global: true,
  optionsProvider: {
    useFactory(configService: ConfigService) {
      return configService.get<IConfig['captcha']>('captcha')
    },
    inject: [ConfigService]
  }
}
